<?phpnamespace app\common\model;use think\Db;use think\Exception;use think\Model;class Collect extends Model{    /**     * 获取收藏数量或者某人是否收藏     * @param $related_id 关联的id     * @param $is_operate_id 用户id是否收藏     * @return int|string|array     * @throws Exception     */    public static function number($related_id,$is_operate_id =''){        $con = [];        if(!empty($related_id)){            $con['related_id'] = $related_id;        }        if(empty($is_operate_id)){            return  self::where($con)->count();        }else{            $count = self::where($con)->count();            $con['operate_id'] =$is_operate_id;            $is_operate = self::where($con)->count();            return ['count'=>$count,'is_collect'=>$is_operate];        }    }}